﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Practices.Prism.ViewModel;
using Astor.UI.Framework.ViewModels;
using System.ComponentModel.DataAnnotations;

namespace Astor.Modules.DataSources.Models
{
    public class DataSource : DomainObject
    {
        public static class PropertyNames
        {
            public static readonly string Name = "Name";
            public static readonly string Url = "Url";
            public static readonly string Id = "Id";
        }

        private string _name;
        private string _url;

        public Guid Id { get; set; }

        [Required]
        public string Name
        {
            get { return _name; }
            set
            {
                if (_name != value)
                {
                    this.ValidateProperty(() => Name, value);
                    this._name = value;
                    this.RaisePropertyChanged(() => Name);
                }
            }
        }

        [Required]
        public string Url
        {
            get { return _url; }
            set
            {
                if (_url != value)
                {
                    this.ValidateProperty(() => Url, value);
                    this._url = value;
                    this.RaisePropertyChanged(() => Url);
                }
            }
        }
    }
}
